<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-b1-supplier clearfix">
		<div th:replace="common/left::side"></div>
    	<section class="content">

        <h3 class="m-top-bar">
            <!--<img src="../images/temp/pic_30x30_01.jpg" alt=""/>
            <a href="#">HUAWEI Tech
                <icon class="icon-btn icon-btn-blue-close"></icon>
            </a>-->
        </h3>

        <div class="m-order-bar">
            <p>
                <strong>处理销售订单</strong>
                <select name="orderStatus" id="orderStatus" th:value="${orderStatus}" onchange="changeOrder(this)">
                    <option value="2" th:if="${orderStatus==2}" selected="selected">已完成订单</option>
                    <option value="2" th:if="${orderStatus!=2}">已完成订单</option>
                    <option value="1" th:if="${orderStatus==1}" selected="selected">待履行订单</option>
                    <option value="1" th:if="${orderStatus!=1}">待履行订单</option>
                    <option value="5" th:if="${orderStatus==5}" selected="selected">全部订单</option>
                    <option value="5" th:if="${orderStatus!=5}">全部订单</option>
                </select>
            </p>
        </div>

        <div class="m-order-bar">
            <table width="100%" summay="" cellpadding="0" cellspacing="0">
                <thead>
                <th width="76">序号</th>
                <th width="150">商品</th>
                <th width="132">计划数量</th>
                <th width="142">已发货数量</th>
                <th width="70">单位</th>
                <th width="142">要求到货日期</th>
                <th width="132">实际到货日期</th>
                <th width="100">操作</th>
                </thead>
            </table>
        </div>

        
        <div class="m-table-sell">
            <div class="m-table-cont"  th:each="salesOrders:${salesOrders}">
                <table width="100%" summay="" cellpadding="0" cellspacing="0">
                    <thead>
                    <tr>
                        <th colspan="2">订单号 : <span th:text="${salesOrders.salesOrderNo}">1200456</span></th>
                        <th colspan="2"><span th:if="${salesOrders.startTime ne null and salesOrders.expiredTime ne null}" th:text="${#dates.format(salesOrders.startTime, 'yyyy-MM-dd')}+' 至 '+${#dates.format(salesOrders.expiredTime, 'yyyy-MM-dd')}">2015-12-12 至 2016-01-12</span></th>
                        <th colspan="2"><span th:text="${salesOrders.tCompany.companyName}">百度在线网络技术有限公司</span></th>
                        <th colspan="2">总金额 :<span th:text="${salesOrders.currency eq 0}? '￥':'$'"/><span th:text="${#numbers.formatInteger(salesOrders.price,1)}">￥1000000</span></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="salesOrdersItems,index:${salesOrders.tSalesOrderItems}">
                    	<td width="74">
                    		<span th:if="${#strings.length(index.count) eq 1}" th:text="${#strings.prepend(index.count,'00')}"/>
                    		<span th:if="${#strings.length(index.count) eq 2}" th:text="${#strings.prepend(index.count,'0')}"/>
                    		<span th:if="${#strings.length(index.count) eq 3}" th:text="${index.count}"/>
                    	</td>
                        <td width ="140">
                        	<p><img width="70" height="40" th:if="${salesOrdersItems.materialPic ne null}" th:src="${salesOrdersItems.materialPic}" alt=""/></p>
                            <p><span th:text="${salesOrdersItems.tMaterialMasterClient.materialName}">每行最多十六个字多了折行</span></p>
                        </td>
                        <td width="120"><span th:text="${#numbers.formatInteger(salesOrdersItems.quantity,1)}">220150</span></td>
                        <td width="142"><span th:text="${#numbers.formatInteger(salesOrdersItems.quantityDelivered,1)}"/></td>
                        <td width="55" th:text="${salesOrdersItems.tUnit.unitName}"></td>
                        <td width="142"><label th:if="${salesOrdersItems.planedTime ne null}" th:text="${#dates.format(salesOrdersItems.planedTime, 'yyyy-MM-dd')}"></label></td>
                        <td width="142"><label th:if="${salesOrdersItems.actualTime ne null}" th:text="${#dates.format(salesOrdersItems.actualTime, 'yyyy-MM-dd')}"></label></td>
                        <td width="100" th:if="${index.count==1}" class="td-rowspan vaT w80" rowspan="3">
                            <a class="btn btn-cyan" th:href="@{/supplier/preCreateOrder.htm(salesOrderID=${salesOrders.id})}">修改订单</a>
                            <br/>
                            <a th:href="@{/supplier/preCreateDelivery.htm(salesOrderID=${salesOrders.id})}">新发货单</a>
                            <br/>
                            <a th:href="@{/supplier/checkOrder.htm(salesOrderID=${salesOrders.id})}">验收申请</a>
                            <br/>
                            <a th:href="@{/supplier/checkOrder.htm?(salesOrderID=${salesOrders.id})}">新发票</a>
                            <br/>
                            <a th:href="@{/supplier/orderCheck.htm}">订单评估</a>
                        </td>
                    </tr>
                    <tr>
                        <td class="td-flow-bar" colspan="7" >
                            <div class="flow-bar">
                              	<span th:each="purchaseOrderPayment,index:${salesOrders.tSalesOrderPayment}" >
                           		    <span th:if="${index.count!=index.size} and ${purchaseOrderPayment.milestoneType==1}" th:text="待发货" class="icon icon-flow-red" ></span> 
                                	<span th:if="${index.count!=index.size} and ${purchaseOrderPayment.milestoneType==2}" th:text="已发货"  class="icon icon-flow-green" ></span>
                                	<span th:if="${index.count!=index.size} and ${purchaseOrderPayment.milestoneType==3}" th:text="已验货"  class="icon icon-flow-green" ></span>
                                	<span th:if="${index.count!=index.size} and ${purchaseOrderPayment.milestoneType==4}" th:text="已验收"  class="icon icon-flow-green" ></span>
                                	<span th:if="${index.count!=index.size} and ${purchaseOrderPayment.milestoneType==5}" th:text="已收发票"  class="icon icon-flow-green" ></span> 
                                	<span th:if="${index.count!=index.size} and ${purchaseOrderPayment.milestoneType==6}" th:text="已付款"  class="icon icon-flow-green" ></span>  
                                	
                                	
                                	<span th:if="${index.count==index.size} and ${purchaseOrderPayment.milestoneType==1}" th:text="待发货"  class="icon-flow-simple-red02" ></span> 
                                	<span th:if="${index.count==index.size} and ${purchaseOrderPayment.milestoneType==2}" th:text="已发货"  class="icon-flow-simple-red02" ></span>
                                	<span th:if="${index.count==index.size} and ${purchaseOrderPayment.milestoneType==3}" th:text="已验货"  class="icon-flow-simple-red02" ></span>
                                	<span th:if="${index.count==index.size} and ${purchaseOrderPayment.milestoneType==4}" th:text="已验收"  class="icon-flow-simple-red02" ></span>
                                	<span th:if="${index.count==index.size} and ${purchaseOrderPayment.milestoneType==5}" th:text="已收发票"  class="icon-flow-simple-red02" ></span> 
                                	<span th:if="${index.count==index.size} and ${purchaseOrderPayment.milestoneType==6}" th:text="已付款"  class="icon-flow-simple-red02" ></span>
                              
                                </span>
                              
                                
                               <!--  <span class="icon icon-flow-green">已发货</span>
                                <span class="icon icon-flow-green">已验收</span>
                                <span class="icon icon-flow-green">已收发票</span>
                                <span class="icon icon-flow-green">已付款</span>
                                <span class="icon-flow-simple-green01">等待交货</span>
                                <span class="icon-flow-simple-green02">等待交货</span>
                                <span class="icon-flow-simple-red01">等待交货</span> -->
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>


    </section>

</article>

</body>
    <script data-main="../js/page/b1_supplier" src="../lib/requirejs/require.js"></script>
	<script type="text/javascript" src="../lib/jquery/dist/jquery.js"></script>
	<script type="text/javascript" src="../js/page/b2_order.js"></script>
</html>